package com.automannn.websocketmqtt.websocketNodeB.pubsub.provider;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;

/**
 * @author chenkh
 * @time 2020/10/15 16:27
 */
@Component
public class WsRedisPublisher {

    @Autowired
    private RedisTemplate redisTemplate;

    /**
     * 向指定频道发送信息
     */
    public void publish(String channel,Object object){
        redisTemplate.convertAndSend(channel,object);
    }
}
